﻿<phone:PhoneApplicationPage x:Class="HelloWindowsPhoneMVC.Views.Home.MainPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:commands="clr-namespace:WindowsPhoneMVC.Commands;assembly=WindowsPhoneMVC"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns:Home="clr-namespace:HelloWindowsPhoneMVC.ViewModels.Home"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            mc:Ignorable="d"
                            d:DesignHeight="768"
                            d:DesignWidth="480"
                            shell:SystemTray.IsVisible="True"
                            d:DataContext="{d:DesignInstance Home:MainViewModel}">
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn" />
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn" />
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut" />
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut" />
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    <StackPanel Margin="10"
                VerticalAlignment="Center">
        <TextBlock Text="This hello world app is a mismash of all the features of WP7 MVC"
                   Margin="12"
                   TextWrapping="Wrap" />
        <TextBox Text="{Binding Name, Mode=TwoWay}" />
        <Button commands:Click.Command="{Binding DebugPageCommand}"
                Content="Debug Page" />
        <Button commands:Click.Command="{Binding ShowGreetingPageCommand}"
                Content="Say hello" />
        <Button commands:Click.Command="{Binding CreateDeepLinkCommand}"
                Content="Deep Link" />
        <Button commands:Click.Command="{Binding ShowAnotherExamplePageCommand}"
                Content="Different Controller" />
        <Button commands:Click.Command="{Binding ShowAnotherExamplePageCommand}"
                Content="Different Controller" />
        <!--
        Imagine you have a button in a list, so the data context is different. 
        Navigate.To will pass the current datacontext if the action asks for it
        -->
        <Button commands:Navigate.To="Home.About"
                DataContext="{Binding SomeItem}"
                Content="About" />
    </StackPanel>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True">
            <!--To explicitly set a command/method to be called, put it in square brackets-->
            <shell:ApplicationBarIconButton IconUri="/appbar.add.rest.png"
                                            Text="Save[SaveCommand]" />
            <!--Fallback Convention is to look for a method with the same text (with spaces removed as the application bar button)-->
            <shell:ApplicationBarIconButton IconUri="/appbar.add.rest.png"
                                            Text="Save" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>
